<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js" type="text/javascript"></script>
</head>
<body>
    <div id="app" @click="divClick">
        <!-- .stop修饰符的使用 -->
        <button @click.stop="btnClick">btnClick</button>
        <!-- .prevent修饰符 -->
        <form action="baidu.com">
            <input type="submit" @click.prevent="subimtClick" value="submitClick"/>
        </form>
        <!-- .keyup监听键盘输入 -->
        <input type="text" @keyup.enter="keyUp">
        <!-- .once只触发一次回调 -->
        <button @click.once="doThis">onceClick</button>
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                
            },
            methods: {
                btnClick: function(){
                    console.log("btnClick");
                },
                divClick(){
                    console.log("divClick");
                },
                subimtClick(){
                    console.log("submitClick");
                },
                keyUp(){
                    console.log("keyUp");
                },
                doThis(){
                    console.log("doThis");
                }
            }
        })
    </script>
</body>
</html>